package com.jlkf.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jlkf.dao.BackCourseInfoDao;
import com.jlkf.pojo.TblCourse;
import com.jlkf.service.BackCourseInfoService;
import com.platform.server.response.response.pojo.ReturnData;

@Service
public class BackCourseInfoServiceImpl implements BackCourseInfoService{
	
	@Autowired
	private BackCourseInfoDao backCourseInfoDao;

	/**
	 * 查看课程列表
	 */
	@Override
	public List<Map<String, Object>> selectCourseInfoList(Map<String, Object> map) {
		return backCourseInfoDao.selectCourseInfoList(map);
	}
	
	/**
	 * 查看课时列表
	 */
	@Override
	public List<Map<String, Object>> selectLessonList(Map<String, Object> map) {
		return backCourseInfoDao.selectLessonList(map);
	}

	/**
	 * 删除课程
	 */
	@Override
	public int deleteCourse(String id) {
		return backCourseInfoDao.deleteCourse(id);
	}
	
	/**
	 * 删除课时
	 */
	@Override
	public int deleteLesson(Map<String,Object> map) {
		return backCourseInfoDao.deleteLesson(map);
	}
	
	/**
	 * 根据关键字查看视频列表
	 */
	@Override
	public List<Map<String,Object>> selectVideoList(Map<String, Object> map) {
		return backCourseInfoDao.selectVideoList(map);
	}

	/**
	 * 添加课程
	 */
	@Override
	public int insertCourse(Map<String, Object> map) {
		return backCourseInfoDao.insertCourse(map);
	}
	
	/**
	 * 编辑课程
	 */
	@Override
	public int updateCourse(Map<String, Object> map) {
		return backCourseInfoDao.updateCourse(map);
	}

	/**
	 * 查看老师列表
	 */
	@Override
	public List<Map<String, Object>> selectTeacherList(Map<String, Object> map) {
		return backCourseInfoDao.selectTeacherList(map);
	}

	/**
	 * 删除老师
	 */
	@Override
	public int deleteTeacher(String id) {
		return backCourseInfoDao.deleteTeacher(id);
	}
	
	/**
	 * 添加老师
	 */
	@Override
	public int insertTeacher(Map<String, Object> map) {
		return backCourseInfoDao.insertTeacher(map);
	}
	
	/**
	 * 修改老师
	 */
	@Override
	public int updateTeacher(Map<String, Object> map) {
		return backCourseInfoDao.updateTeacher(map);
	}

	/**
	 * 查看职业方向列表
	 */
	@Override
	public List<Map<String, Object>> selectTprofessionSort() {
		return backCourseInfoDao.selectTprofessionSort();
	}

	/**
	 * 查看课程一级二级跟三级分类
	 */
	@Override
	public List<Map<String, Object>> selectCourseOneStair(Integer id) {
		return backCourseInfoDao.selectCourseOneStair(id);
	}

	/**
	 * 热搜列表
	 */
	@Override
	public List<Map<String, Object>> hotList() {
		return backCourseInfoDao.hotList();
	}

	/**
	 * 删除热搜
	 */
	@Override
	public int deleteHot(String id) {
		return backCourseInfoDao.deleteHot(id);
	}

	/**
	 * 添加热搜
	 */
	@Override
	public int insertHot(String G_KEYWORDS) {
		return backCourseInfoDao.insertHot(G_KEYWORDS);
	}

	/**
	 * pc端下拉课程列表
	 */
	@Override
	public List<Map<String, Object>> dropdownList(Map<String,Object> map) {
		return backCourseInfoDao.dropdownList(map);
	}

	/**
	 * 导入课程
	 */
	@Override
	public ReturnData readExcelCourse(TblCourse tblCourse) {
		int flag =  backCourseInfoDao.readExcelCourse(tblCourse);
		if(flag == 1){
			return new ReturnData(200,"添加成功");
		}else{
			return new ReturnData(100,"添加失败");
		}
	}


}
